package com.andy.note.boot.config;

import com.andy.note.main.jsoup.gdhtcm.DailyAnalyse;
import com.andy.note.main.jsoup.gdhtcm.DoctorAnalyseEntity;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn;

import javax.annotation.PostConstruct;

/**
 * 
 * 
 *
 * @author Andy<908119428@qq.com>
 * @version $Revision: 1.1 $ $Date: 2021年8月6日 上午11:33:21 $
 */
@Configuration
@Slf4j
public class TestBeanConfig {

//    public TestBeanConfig(DailyAnalyse dailyAnalyse) {
//        System.out.println("Configuration successful!!!");
//    }
//
//    static {
//        System.out.println("static method successful!!!");
//    }

    @Autowired
    DailyAnalyse dailyAnalyse;
    
    @PostConstruct
    public void testPostCon() {
        log.info("0000");
        System.out.println(0000);
    }
    
    @Bean(initMethod = "init", destroyMethod = "dele")
    @DependsOn("dailyAnalyse")
    public DoctorAnalyseEntity doctorAnalyseEntity() {
        DoctorAnalyseEntity de = new DoctorAnalyseEntity();
        System.out.println("111111111111");
        return de;
    }
    
    @Bean
    public DailyAnalyse dailyAnalyse() {
        DailyAnalyse da = new DailyAnalyse();
        da.setFifBookCount("3333333333");
        System.err.println("222222222222");
        log.info("222222222222");
        return da;
    }
    
    @Bean
    public void test() {
        System.err.println(dailyAnalyse.getFifBookCount());
    }
    
    
}
